// @ts-ignore
/* eslint-disable */
import { OpenApi as request } from "@/utils/request";

/** 独立平台分页 GET /supplyChain/platform */
export async function listPage3(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.listPage3Params,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageRespSupplyChainPlatformAccountVo>(
    `/barter-user/supplyChain/platform`,
    {
      method: "GET",
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}

/** 新增独立平台 POST /supplyChain/platform */
export async function add3(
  body: API.SupplyChainPlatformAccountDto,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>(`/barter-user/supplyChain/platform`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    data: body,
    ...(options || {}),
  });
}

/** 独立平台详情 GET /supplyChain/platform/${param0} */
export async function detail3(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.detail3Params,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseSupplyChainPlatformAccountVo>(
    `/barter-user/supplyChain/platform/${param0}`,
    {
      method: "GET",
      params: { ...queryParams },
      ...(options || {}),
    }
  );
}

/** 编辑独立平台 PUT /supplyChain/platform/${param0} */
export async function edit1(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.edit1Params,
  body: API.SupplyChainPlatformAccountDto,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseBoolean>(
    `/barter-user/supplyChain/platform/${param0}`,
    {
      method: "PUT",
      headers: {
        "Content-Type": "application/json",
      },
      params: { ...queryParams },
      data: body,
      ...(options || {}),
    }
  );
}

/** 删除独立平台 DELETE /supplyChain/platform/${param0} */
export async function del9(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.del9Params,
  options?: { [key: string]: any }
) {
  const { id: param0, ...queryParams } = params;
  return request<API.BaseResponseBoolean>(
    `/barter-user/supplyChain/platform/${param0}`,
    {
      method: "DELETE",
      params: { ...queryParams },
      ...(options || {}),
    }
  );
}

/** 状态切换 POST /supplyChain/platform/disable */
export async function disable1(
  body: API.IdDto,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean>(
    `/barter-user/supplyChain/platform/disable`,
    {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
      },
      data: body,
      ...(options || {}),
    }
  );
}
